package com.woniuxy.platform.core.mapper;

import com.woniuxy.platform.core.model.PlOrderitem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.platform.core.vo.OrderItemVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gmx
 * @since 2021-07-12
 */
public interface PlOrderitemMapper extends BaseMapper<PlOrderitem> {
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id WHERE `status`=0")
    List<OrderItemVo> selectUnpaid( );
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id WHERE `status`=1")
    List<OrderItemVo> selectUnChecked();
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id WHERE `status`=2")
    List<OrderItemVo> selectUnServiced();
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id WHERE `status`=3")
    List<OrderItemVo> selectUnEvaluate();
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id WHERE `status`=4")
    List<OrderItemVo> selectUnAfterSale();
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id WHERE `status`=5")
    List<OrderItemVo> selectFinished();
    @Select("SELECT * FROM pl_orderitem oi LEFT JOIN pl_order o ON oi.order_id=o.id")
    List<OrderItemVo> selectAll();
}
